#include<iostream>
#include <cstring>
using namespace std;
class robot{
	private:
		char *name;
		int hp; 	//Health Point血量
		int ce;		//Combat Effectiveness伤害值 
		int df;		//Defence防御值
		char type;
		int lv; 
	public:
		robot(char *n,char t,int l):type(t),lv(l){
			name=new char[strlen(n)+1];
			strcpy(name,n);
			if(type=='N'){	//判断机器人类型来赋值
				hp=5*lv;
				ce=5*lv;
				df=5*lv;
			}
			if(type=='A'){
				hp=5*lv;
				ce=10*lv;
				df=5*lv;
			}
			if(type=='D'){
				hp=5*lv;
				ce=5*lv;
				df=10*lv;
			}
			if(type=='H'){
				hp=50*lv;
				ce=5*lv;
				df=5*lv;
			}
		}
		void print(){
				cout<<name<<"--"<<type<<"--"<<lv<<"--"<<hp<<"--"<<ce<<"--"<<df<<endl;	
			}
		~robot(){
			if(name!=NULL)
				delete name;
			}
		friend bool transform(robot *r1,char t);
			
}; 
bool transform(robot *r1,char t){
	if(r1->type==t)
		return 0;
	r1->type=t;
		if(t=='N'){
			r1->hp=5*r1->lv;
			r1->ce=5*r1->lv;
			r1->df=5*r1->lv;
			}
		if(t=='A'){
			r1->hp=5*r1->lv;
			r1->ce=10*r1->lv;
			r1->df=5*r1->lv;
			}
		if(t=='D'){
			r1->hp=5*r1->lv;
			r1->ce=5*r1->lv;
			r1->df=10*r1->lv;
			}
		if(t=='H'){
			r1->hp=50*r1->lv;
			r1->ce=5*r1->lv;
			r1->df=5*r1->lv;
			}
		return 1;
}
int main(){
	char n[20],type;
	int t,hp,ce,df,lv,num=0;
	robot *p;
	cin>>t;
	while(t--){
		cin>>n>>type>>lv;
		robot r1(n,type,lv);
		p=&r1;
		cin>>type;
		num+=transform(p,type); 
		p->print();
	} 
	cout<<"The number of robot transform is "<<num;
	return 0;
}

